if bkgnd field "Hard Disk?" contains "true" then --Hard Disk Icon
set icon of bkgnd btn "Box Name" to 23929
put "Page#:" into bkgnd field "Name Of Page"
else
set icon of bkgnd btn "Box Name" to 24438 -- Floppy Disk Icon
put "Disk#:" into bkgnd field "Name Of Page"
end if
if bkgnd field "Files" is empty then -- card is new or erased
put (item 2 of the abbr date)&", "&(item 3 of the abbr date)into bkgnd field "Date"
-- XCMD written by me to index through all files on a disk.
-- it reads the directory into 6 bkgnd fields. See Help file for
-- more details. No parameter signals floppy disk, parameter >0
-- signals hard disk.
if "Template" is not in the short name of this card then
set lockScreen to true
if fromXCMD contains false then
if hardDisk contains true then
ReadAutoCat 1
else
ReadAutoCat
end if
end if
set lockScreen to false
end if
--index it
if bkgnd field "Box Card" is not empty then
put bkgnd field "Box Card" into indxCrd
put line 1 of bkgnd field "Volume" into vCard -- volume name
if vCard is empty then
-- Volume name obtained from XCMD for hard disk pages
put line 1 of volumeXCMD into vCard
end if
put the id of this card into cID
put bkgnd field "PageOfBox" into linos -- Disk Number
-- put the volume in the Index Box
put vCard into line (linos) of bkgnd field "Box Index" of card indxCrd
-- store the ID of the card
put cID into line (linos) of bkgnd field "Card Index" of card indxCrd
end if
end if
put false into fromXCMD
end openCard
on DeleteCard
-- remove the volume name from the index card
set cursor to 4
if bkgnd field "Box Card" is not empty then
put bkgnd field "Box Card" into indxCrd
put bkgnd field "PageOfBox" into linos
set lockScreen to true
set lockMessages to true
push card
go to card indxCrd
if the result is not empty then
pop card
pass DeleteCard
else
put empty into line (linos) of bkgnd field "Box Index" of card indxCrd
pop card
end if
end if
end DeleteCard
-- part 12 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=71 top=278 right=290 bottom=129
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: TotalSize
-- part 1 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=107 top=26 right=45 bottom=369
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 4352
-- line height: 16
-- part name: Volume
-- part 50 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=20 top=48 right=278 bottom=92
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 8192
-- line height: 12
-- part name: Modified
----- HyperTalk script -----
-- Date Last Modified
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
on mouseUp
send mouseUp to bkgnd field "Files"
end mouseUp
--find field line clicked on
function lineClicked
return (round((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1)))
end lineClicked
-- part 60 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=75 top=48 right=278 bottom=142
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Size
----- HyperTalk script -----
--Size
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
on mouseUp
send mouseUp to bkgnd field "Files"
end mouseUp
--find field line clicked on
function lineClicked
return (round((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1)))
end lineClicked
-- part 3 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=118 top=48 right=278 bottom=162
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 150
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Kind
----- HyperTalk script -----
--Small Icon
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
on mouseUp
send mouseUp to bkgnd field "Files"
end mouseUp
--find field line clicked on
function lineClicked
return (round((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1)))
end lineClicked
-- part 2 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=145 top=48 right=278 bottom=353
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Files
----- HyperTalk script -----
-- File Name
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
-- find line clicked on
on mouseUp
global applPath
set cursor to 4
put lineClicked() into selectedfileLine
put false into flag
put the ticks into originalTicks
repeat until the mouseClick -- flag a single click
if the ticks - originalTicks > 30 then
put true into flag -- single click
exit repeat
end if
end repeat
if flag contains true then
-- dialog box to display pathway XFCN
put ShowPath (selectedfileLine,1) into pathResult
if applPath is not empty then
-- contains application pathname if Record is selected
put applPath after bkgnd field "APPL Pathways" of card "Applications"
answer "The pathname has been recorded." with "OK"
end if
end if
if flag contains false then -- on double click
-- the parameter of 2 allows calculation of pathname without
-- displaying dialog box.
put ShowPath (selectedfileLine,2) into pathResult
end if
-- results of XFCN
put line 1 of pathResult into thePathName
put line 2 of pathResult into theFileType
put line 3 of pathResult into theCreator
if theFileType contains "STAK" then -- if you chose a HC stack
go to stack thePathName
exit mouseUp
end if
if theFileType contains "APPL" then -- if you chose an application
open thePathName
exit mouseUp
end if
if theFileType contains numToChar(45)&numToChar(45)&numToChar(45)&numToChar(45) then -- you chose a folder
answer "You cannot launch a folder." with "True"
exit mouseUp
end if
if theFileType is not empty then -- launch a document?
-- XFCN to check applications page for pathname with same
-- Creator, i.e., the proper application for the document
put CheckApplList (theCreator) into checkList
if checklist is empty then
answer "Choose an Application for this Document?" with "Cancel" or "OK"
if it contains "Cancel" then exit mouseUp
-- a mutant and inelegant XFCN similar in result to Steve Maller's
-- fileName("APPL"), i.e., gets full pathname of an application
-- chosen via the Standard File Package
put GetFilePath() into appPath
if appPath is empty then
exit mouseUp
end if
else
put checkList into appPath
end if
open thePathName with appPath -- open document with application
exit mouseUp
end if
exit mouseUp
end mouseUp
-- part 61 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=352 top=48 right=278 bottom=407
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Type
----- HyperTalk script -----
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
on mouseUp
send mouseUp to bkgnd field "Files"
end mouseUp
--find field line clicked on
function lineClicked
return (round((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1)))
end lineClicked
-- part 62 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=390 top=48 right=278 bottom=448
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Creator
----- HyperTalk script -----
-- multiple scroll
on mouseWithin
global initScroll
ScrollEm (the scroll of me)
end mouseWithin
on mouseUp
send mouseUp to bkgnd field "Files"
end mouseUp
--find field line clicked on
function lineClicked
return (round((the scroll of the target / the textHeight of the target) + (((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1)))
end lineClicked
-- part 67 (button)
-- low flags: 00
-- high flags: 0001
-- rect: left=432 top=48 right=278 bottom=454
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
-- part 57 (field)
-- low flags: 80
-- high flags: 0007
-- rect: left=281 top=60 right=302 bottom=372
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: AllInfo
-- part 6 (button)
-- low flags: 00
-- high flags: A000
-- rect: left=442 top=190 right=237 bottom=497
-- title width / last selected line: 0
-- icon id / first selected line: 5929 / 5929
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Erase Fields
----- HyperTalk script -----
on mouseUp
answer "Erase current fields?" with "OK" or "Cancel"
if it contains "Cancel" then exit mouseUp
if bkgnd field "Box Card" is not empty then
put bkgnd field "Box Card" into indxCrd
put bkgnd field "PageOfBox" into linos
set lockScreen to true
push card
go to card indxCrd
if the result is not empty then
pop card
else
put "Empty" into line (linos) of bkgnd field "Box Index" of card indxCrd
pop card
end if
end if
repeat with i =1 to 12
put empty into bkgnd field i
end repeat
end mouseUp
-- part 7 (button)
-- low flags: 00
-- high flags: A000
-- rect: left=449 top=141 right=188 bottom=491
-- title width / last selected line: 0
-- icon id / first selected line: 20605 / 20605
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Read Disk
----- HyperTalk script -----
on mouseUp
global fromXCMD
if bkgnd field "Files" is empty then
eraseEm
put false into fromXCMD
openCard
else
answer "Erase current fields?" with "Yes" or "Cancel"
if it contains "Yes" then
eraseEm
put false into fromXCMD
openCard
end if
end if
end mouseUp
on eraseEm
repeat with i =1 to 12
put empty into bkgnd field i
end repeat
end eraseEm
-- part 11 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=202 top=278 right=290 bottom=245
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: TotalFolders
-- part 10 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=348 top=278 right=290 bottom=393
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: TotalFiles
-- part 8 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=159 top=313 right=336 bottom=185
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
-- go back
put bkgnd field "PageOfBox" into oPage
put word 1 to ((the number of words in the short name of this card )-1) of the short name of this card into oCard
put oCard&&oPage-1 into nCard
visual effect scroll right
go to card nCard
end mouseUp
-- part 64 (field)
-- low flags: 80
-- high flags: 0004
-- rect: left=369 top=27 right=47 bottom=428
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Disk Page
-- part 9 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=297 top=313 right=336 bottom=322
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
global fromXCMD, hardDisk
put false into tempCheck
-- give the option of adding a new page if there isn't one
put bkgnd field "PageOfBox" into oPage --the page number of this card
put bkgnd field "Box Name" into boxName -- current box name
put bkgnd field "Box Card" into oIndex -- name of index card
put bkgnd field "Volume" into oVol
-- get the name of this card without any numerical suffix
put word 1 to ((the number of words in the short name of this card )-1) of the short name of this card into oCard
-- set the name of the new card to the same as this but with a numerical
-- suffix one number greater, then go to the new card (or next card)
put oCard&&oPage+1 into nCard
visual effect scroll left
go to card nCard
-- if the next card doesn't exist, prepare to make one.
if the result is not empty then
-- a flag for marking when the last existing card in a box is arrived at, for
-- use when this script is called from the New Card button
global checkIt
put TRUE into checkIt
-- make the new card if you want to
if fromXCMD contains false then
answer "Add a page?" with "Cancel" or "OK"
if it contains "OK" then
put true into tempCheck
end if
else
put true into tempCheck
end if
if tempCheck contains true then
set lockMessages to true
doMenu New Card
set the name of this card to nCard
put oPage+1 into bkgnd field "PageOfBox" of card nCard
put boxName into bkgnd field "Box Name" of card nCard
put oIndex into bkgnd field "Box Card" of card nCard
if fromXCMD contains TRUE then
put oVol into bkgnd field "Volume" of card nCard
end if
if hardDisk contains true then
put "true" into bkgnd field "Hard Disk?"
put "Page#:" into bkgnd field "Name Of Page"
else
put "false" into bkgnd field "Hard Disk?"
put "Disk#:" into bkgnd field "Name Of Page"
end if
set lockMessages to false
-- to avoid too much recursion, now that the card is all nicely
-- created we can send an openCard to call up the ReadAutoCat